<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <fathercpn></fathercpn>
    </div>
</body>
<script src="../js/http_cdn.bootcdn.net_ajax_libs_vue_2.6.6_vue.js"></script>
<script>
    const sonCpn = Vue.extend({
        template: `
            <div>
                <h2>我是子组件标题</h2>
            </div>
        `
    })


    const fatherCpn = Vue.extend({
        data() {
            return {
                msg:'我是父组件标题'
            }
        },
        template: `
            <div>
                <sonCpn></sonCpn>
                <h1>{{msg}}</h1>
            </div>
        `,
        components: {
            sonCpn: sonCpn
        }

    })

    new Vue({
        el: "#app",
        components:{
            fathercpn:fatherCpn
        }
    })
</script>

</html>
